
TARGET=main

OBJS += $(patsubst %.c,%.o,$(wildcard *.c))

CFLAGS += -DDEBUG 
CFLAGS += -fPIC -g 

LDFLAGS += -lpthread

LDLIBS  +=  -L.. -llfs 



all: lfs $(TARGET)

lfs: .FORCE
	make -C .. -f Makefile.lfs 
lfs_clean: .FORCE
	make -C .. -f Makefile.lfs clean

$(TARGET): $(OBJS)

clean: lfs_clean
	$(RM) $(TARGET) $(OBJS) *.img

.PHONY: all clean lfs lfs_clean

.FORCE:
